<?php
    require_once('../config/tce_config.php');
    error_reporting(E_ALL);
    if(!isset($_SESSION)) 
    { 
        session_start(); 
    } 
    //读出访问次数
    $counter = intval(file_get_contents("counter.dat"));
    if(!isset($_SESSION['counter']))
    {  
     $_SESSION['counter'] = $counter;  
     //访问次数+1
     $counter++;
     //将访问次数保存到counter.dat文件中
     $fp = fopen("counter.dat","w");  
     fwrite($fp, $counter);
     fclose($fp);  
    }
    //输出访问次数
    echo "<center><div>网站访问数为：$counter</div></div>";

    $sql = 'select count(1) cnt from tce_tests_users';
        if ($r = F_db_query($sql, $db)) {
            if ($m = F_db_fetch_array($r)) {
                $cnt = $m['cnt'];
            }
        } else {
            F_display_db_error();
        }
    echo "<div>考试人次：$cnt</div>";
?>
